a = {'a':1,'b':['1','2'],'c':{'a':'3'},'d':[{'a':[3,4]},]}

def to_new_value(v):
    """
    修改传入json的数值
    :param v:
    :return:
    """
    return f'修改的{v}'

def dict_get_all_value(json_obj,by_value=''):
    """
    获取所有值传入to_new_value方法
    :param json_obj:
    :return:
    """
    if isinstance(json_obj, dict):
        return {key: dict_get_all_value(value,) for key, value in json_obj.items()}
    elif isinstance(json_obj, list):
        return [dict_get_all_value(item,) for item in json_obj]
    else:
        return to_new_value(json_obj)



nv=dict_get_all_value(a)
print(nv)
"""
{'a': '修改的1', 'b': ['修改的1', '修改的2'], 'c': {'a': '修改的3'}, 'd': [{'a': ['修改的3', '修改的4']}]}
"""
